این کد اگر نظری نباشه دکمه نمایش نمیده

<script>
jQuery(document).ready(function ($) {
  if ($(".woocommerce-noreviews").length === 0) {
    const filterButtonsHTML = `
      <div id="sigmaweb-review-filters" style="margin-bottom: 15px;">
          <button class="sigmaweb-filter-btn active" data-rating="all">همه</button>
          <button class="sigmaweb-filter-btn" data-rating="buyers">فقط خریداران</button>
      </div>
    `;

    $("#comments .woocommerce-Reviews-title").after(filterButtonsHTML);

    if ($("#sigmaweb-no-comments-message").length === 0) {
      $("#comments").append(
        '<p id="sigmaweb-no-comments-message" style="display: none;">نظری با این شرایط یافت نشد.</p>'
      );
    }

    $(document).on("click", ".sigmaweb-filter-btn", function () {
      var rating = $(this).data("rating");

      $(".sigmaweb-filter-btn").removeClass("active");
      $(this).addClass("active");

      $("#sigmaweb-no-comments-message").hide();
      $(".commentlist li").hide();

      if (rating === "all") {
        $(".commentlist li").show();
      } else if (rating === "buyers") {
        var filtered = $(".commentlist li").filter(function () {
          return $(this).find(".woocommerce-review__verified.verified").length > 0;
        });

        if (filtered.length > 0) {
          filtered.show();
        } else {
          $("#sigmaweb-no-comments-message").show();
        }
      }
    });
  }
});
</script>

